CREATE TABLE [dbo].[DnnProduct_EventLogConfig]
(
[ID] [int] NOT NULL IDENTITY(1, 1),
[LogTypeKey] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LogTypePortalID] [int] NULL,
[LoggingIsActive] [bit] NOT NULL,
[KeepMostRecent] [int] NOT NULL,
[EmailNotificationIsActive] [bit] NOT NULL,
[NotificationThreshold] [int] NULL,
[NotificationThresholdTime] [int] NULL,
[NotificationThresholdTimeType] [int] NULL,
[MailFromAddress] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MailToAddress] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_EventLogConfig] ADD CONSTRAINT [PK_DnnProduct_EventLogConfig] PRIMARY KEY CLUSTERED  ([ID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_DnnProduct_LogTypeKey_DnnProduct_LogTypePortalID] ON [dbo].[DnnProduct_EventLogConfig] ([LogTypeKey], [LogTypePortalID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_EventLogConfig] ADD CONSTRAINT [FK_DnnProduct_EventLogConfig_DnnProduct_EventLogTypes1] FOREIGN KEY ([LogTypeKey]) REFERENCES [dbo].[DnnProduct_EventLogTypes] ([LogTypeKey])
GO
